package com.woniuxy02;

import java.util.Scanner;

public class Test03 {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        System.out.println("运算数1");
        int numA = scanner.nextInt();
        System.out.println("运算数2");
        int numB = scanner.nextInt();
        System.out.println("运算符号+-*/");
        String operator = scanner.next();
        int result = 0;
        if("+".equals(operator)){
            result = numA + numB;
        }else if("-".equals(operator)){
            result = numA - numB;
        }else if("*".equals(operator)){
            result = numA * numB;
        }else if("/".equals(operator)){
            if (numB!=0) {
                result = numA / numB;
            }
        }
        System.out.println(numA+operator+numB+"="+result);
    }
}
